<!--
 * @Author: sxb
 * @Email: sxb@mail.com
 * @Date: 2020-11-11 14:36:17
 * @Descripttion: 
-->
<template>
  <div class="rewardSubsidiary">
    <basic-container>
      <avue-crud
        ref="crud"
        :page="page"
        :option="tableOption"
        :data="tableData"
        v-model="form"
        :table-loading="tableLoading"
        @on-load="getList"
        @size-change="sizeChange"
        @current-change="currentChange"
        @search-change="searchChange"
        @refresh-change="refreshChange"
      >
        <template slot="goodsRewardAmount" slot-scope="scope">
          <span style="color:#AB82FF" @click="handleGoodsReward()">{{scope.row.goodsRewardAmount}}</span>
        </template>
        <template slot="integralRewardAmount" slot-scope="scope">
          <span
            style="color:#AB82FF"
            @click="handleIntegralReward()"
          >{{scope.row.integralRewardAmount}}</span>
        </template>
        <template slot="userfulIntegral" slot-scope="scope">
          <span style="color:#AB82FF" @click="handleUserfulIntegral()">{{scope.row.userfulIntegral}}</span>
        </template>
      </avue-crud>
    </basic-container>
    <el-dialog
      :visible.sync="dialogGoodsrewardVisible"
      title="商品奖励明细 "
      width="70%"
      @close="GoodsrewardItemVisible"
    >
      <goods-reward />
    </el-dialog>
    <el-dialog
      :visible.sync="dialogIntegralrewardVisible"
      title="积分奖励明细 "
      width="70%"
      @close="IntegralrewardItemVisible"
    >
      <integral-reward />
    </el-dialog>
    <el-dialog
      :visible.sync="dialogUserfulintegralVisible"
      title="积分支出明细 "
      width="70%"
      @close="UserfulintegralItemVisible"
    >
      <integral-expend />
    </el-dialog>
  </div>
</template>

<script>
import { tableOption } from "@/const/crud/account/rewardSubsidiary";
import GoodsReward from "../components/GoodsReward";
import IntegralReward from "../components/IntegralReward";
import IntegralExpend from "../components/IntegralExpend";


export default {
  name: "rewardSubsidiary",
  components: {
    GoodsReward,
    IntegralReward,
    IntegralExpend
  },
  data() {
    return {
      tableData: [
        {
          name: "花花牛（1234567）",
          goodsRewardAmount: 111111,
          integralRewardAmount: 1111,
          promotionRewardAmount: 1111,
          userfulIntegral: 111222,
          rewardSumAmount: 222223,
        },
      ],
      searchForm: {},
      page: {
        total: 20, // 总页数
        currentPage: 1, // 当前页数
        pageSize: 20, // 每页显示多少条
      },
      tableOption: tableOption,
      tableLoading: false,
      form: {},
      searchForm: {},
      dialogGoodsrewardVisible: false,
      dialogIntegralrewardVisible: false,
      dialogUserfulintegralVisible: false,
    };
  },
  methods: {
    getList() {},
    sizeChange(pageSize) {
      this.page.pageSize = pageSize;
    },
    currentChange(current) {
      this.page.currentPage = current;
    },
    searchChange() {
      this.page.currentPage = 1;
      this.getList();
    },
    refreshChange() {
      this.getList(this.page);
    },
    handleGoodsReward: function () {
      this.dialogGoodsrewardVisible = true;
    },
    GoodsrewardItemVisible() {
      this.dialogGoodsrewardVisible = false;
    },
    handleIntegralReward: function () {
      this.dialogIntegralrewardVisible = true;
    },
    IntegralrewardItemVisible() {
      this.dialogIntegralrewardVisible = false;
    },
    handleUserfulIntegral: function () {
      this.dialogUserfulintegralVisible = true;
    },
    UserfulintegralItemVisible() {
      this.dialogUserfulintegralVisible = false;
    },
  },
};
</script>

<style lang="scss" scoped>
</style>